<template>
  <el-table :data="tableData">
   <el-table-column prop="id" label="id"/>
   <el-table-column prop="username" label="username"/>
   <el-table-column prop="nickname" label="nickname"/>
   <el-table-column prop="phone" label="phone"/>
   <el-table-column prop="sex" label="sex"/>
   <el-table-column prop="updatedAt" label="updatedAt"/>
  </el-table>
</template>
<script setup lang="ts">
import { reactive } from 'vue'

import { userList } from '@/apis/user'

const param = reactive({
  pageNum: 1,
  pageSize: 10,
})

const tableData = reactive<Array<any>>([])


function getList() {
  userList(param).then((response) => {
    console.log("🚀 ~ file: index.vue ~ line 17 ~ userList ~ res", response)
    const { total: _total, list, pageNum, pageSize } = response.data
    console.log("🚀 ~ file: index.vue ~ line 19 ~ userList ~ list", list)
    tableData.push(...list)
    console.log("🚀 ~ file: index.vue ~ line 21 ~ userList ~ tableData", tableData)
  });
}

getList()

</script>

